package factoryMethod.product;
import factoryMethod.transport.Transport;

/**
 * @ClassName ProductFactory
 * @Description 产品生产工厂类，
 * @Author dalong
 * @Date 2020/6/27 11:31
 * @Version 1.0
 **/

public abstract class ProductFactory {

    /*1.获取运输方式*/
    public abstract Transport getTransport();

    /*2.获取运输方式,根据类类型确定返回类型*/
    public abstract <T extends Transport> T getTransport(Class<T> c);
    /*
    交付产品
     */
    public void deliver(){
        Transport transport = getTransport();
        transport.deliver();
    }

}
